﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="StudentMainPage.aspx.cs" Inherits="Presentation.StudentMainPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body style="margin-bottom: 187px">
    <form id="form1" runat="server">
    <div>
    <asp:Panel ID="PanelStudentList" runat="server" Height="681px" Width="1088px">
        <fieldset style="width: 1300px; height: 550px">
        <legend >Student List</legend>
        <br />
            <asp:Button ID="btnaddStudent" runat="server" Text="Create New Student" 
                BackColor="#CCCCFF" BorderColor="#CC00FF" BorderStyle="Ridge" BorderWidth="1px" 
                ClientIDMode="Static" Font-Bold="True" Font-Strikeout="False" ForeColor="Black" 
                style="margin-left: 9px" Width="151px" onclick="btnaddStudent_Click"  />
            <br />
            <br />
            <asp:GridView ID="gvStudentInfo" runat="server" 
                CellPadding="4" ForeColor="#333333" GridLines="None"  
                AutoGenerateColumns="False"  onrowdeleting="gvStudentInfo_RowDeleting" 
                onrowediting="gvStudentInfo_RowEditing"  DataKeyNames="StudentId">
                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                <Columns>
                    <asp:BoundField Datafield="StudentId" HeaderText="Student Id" />
                    <asp:BoundField Datafield="StudentName" HeaderText="Student Name" />
                    <asp:BoundField Datafield="StudentGender" HeaderText="Student Gender" />
                    <asp:BoundField Datafield="ClassName" HeaderText="Class Name" />
                    <asp:templatefield>
                        <itemtemplate>
                            <asp:button id="btnupdate" runat="server" causesvalidation="False" 
                                commandname="edit" text="Update" />
                        </itemtemplate>
                    </asp:templatefield>
                    <asp:TemplateField ShowHeader="False">
                        <ItemTemplate>
                            <asp:Button ID="btnDelete" runat="server" CausesValidation="False" 
                                CommandName="Delete" Text="Delete"   
                                onclientclick="javascript:return confirm('really delete？')"  />
                        </ItemTemplate>
                    </asp:TemplateField>
                    
                </Columns>
                <EditRowStyle BackColor="#999999" />
                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                <SortedAscendingCellStyle BackColor="#E9E7E2" />
                <SortedAscendingHeaderStyle BackColor="#506C8C" />
                <SortedDescendingCellStyle BackColor="#FFFDF8" />
                <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
            </asp:GridView>
            <br />

        </fieldset>

        </asp:Panel>
    </div>
    </form>
</body>
</html>
